﻿using Engine.Graphics;
using Game;

namespace Mekiasm.Buff
{
    public class Buff
    {
        public int id;
        public double startGameTime;
        public double endGameTime;
        public SubsystemGameInfo GameInfo;
        private Texture2D texture;
        private BuffView view;        
        public string desc;
        public ComponentPlayer Player;
        public double startValue;//基础属性值
        public double factor;//加成值
        public bool isExec;//是否执行过
        public float Progress { get { return (float)((endGameTime - GameInfo.TotalElapsedGameTime) / (endGameTime - startGameTime)); } }
        public Texture2D Icon { get { if (texture == null) texture = ContentManager.Get<Texture2D>($"Mekiasm/Gui/Buff/Buff_{id}."); return texture; } }
        public BuffView View { get { if (view == null) view = new BuffView(this); return view; } }
        public int RemainTime { get { return (int)(endGameTime - GameInfo.TotalElapsedGameTime); } }
    }
}
